package com.fairplay.test.activity;

import android.os.Bundle;

import androidx.annotation.Nullable;

import com.fairplay.test.fragment.MainFragment;
import com.google.android.material.tabs.TabLayout;
import com.gwm.annotation.router.ARouter;
import com.jetpackframework.base.BaseFragment;
import com.jetpackframework.basemd.BaseTabViewActivity;

import java.util.ArrayList;
import java.util.List;

@ARouter("test/tabview")
public class TabViewActivity extends BaseTabViewActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        arouterActivity("test://${packageName}/test/firend");
    }

    @Override
    protected BaseFragment getFragmentByTab(TabLayout.Tab tab) {
        return new MainFragment();
    }

    @Override
    protected List<TabLayout.Tab> getTabList(TabLayout tab) {
        List<TabLayout.Tab> tabList = new ArrayList<>();
        tabList.add(tab.newTab().setText("娱乐"));
        tabList.add(tab.newTab().setText("资讯"));
        tabList.add(tab.newTab().setText("新闻"));
        tabList.add(tab.newTab().setText("八卦"));
        tabList.add(tab.newTab().setText("小段子"));
        tabList.add(tab.newTab().setText("视频"));
        tabList.add(tab.newTab().setText("关注"));
        tabList.add(tab.newTab().setText("绯闻"));
        tabList.add(tab.newTab().setText("留校"));
        tabList.add(tab.newTab().setText("小子"));
        tabList.add(tab.newTab().setText("任务"));
        tabList.add(tab.newTab().setText("点赞"));
        tabList.add(tab.newTab().setText("周边"));
        tabList.add(tab.newTab().setText("附近"));
        tabList.add(tab.newTab().setText("留意"));
        tabList.add(tab.newTab().setText("大侠"));
        tabList.add(tab.newTab().setText("小鬼"));
        return tabList;
    }
}
